package com.naiterui.ehp.bs.patient.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bp.constants.CommonConstant;
import com.naiterui.ehp.bp.domain.City;

/**
 * <pre>
 * 城市持久化实现
 * </pre>
 *
 * @author fangguanhong
 * @date 2020/4/9 下午3:41
 * @since 1.0.0
 */
@Repository
public interface IApCityRepository extends BaseJpaRepository<City, Integer> {

    List<City> findByTypeAndAvailable(Integer type, boolean available);

    City findFirstByNameLikeAndType(String name, Integer type);

    City findFirstByNameLikeAndParentId(String name, Integer parentId);

    List<City> findByParentIdAndAvailable(Integer parentId, boolean available);
}
